<!DOCTYPE html>
<html>
<head>
<title>员工档案</title>
<#include "/header.html">
</head>
<body>
<div id="witapp" v-cloak>
	<div v-show="showList">
		<div class="grid-btn">
			<div class="form-group col-sm-2">
				<input type="text" class="form-control" v-model="q.key" @keyup.enter="query" placeholder="员工姓名">
			</div>
			<a class="btn btn-default" @click="query">查询</a>
			<#if shiro.hasPermission("employee:save")>
            <a class="btn btn-success" @click="addEmployee"><i class="fa fa-plus"></i>&nbsp;新增</a>
			</#if>
			<#if shiro.hasPermission("employee:update")>
            <a class="btn btn-success" @click="editEmployee"><i class="fa fa-pencil-square-o"></i>&nbsp;编辑</a>
            <a class="btn btn-success" @click="resetPassword"><i class="fa fa-lock"></i>&nbsp;重置密码</a>
			</#if>
            <#if shiro.hasPermission("employee:update")>
            <a class="btn btn-success" @click="viewEmployee"><i class="fa fa-eye"></i>&nbsp;查看</a>
			</#if>
			<#if shiro.hasPermission("employee:delete")>
            <a class="btn btn-success" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</a>
			</#if>
		</div>
	    <table id="jqGrid"></table>
	    <div id="jqGridPager"></div>
    </div>
    
    <div v-show="!showList" class="panel panel-default">
		<div class="panel-heading">{{title}}</div>
        <div style="display:flex;flex-direction:row;">
            <div>
                <form class="form-horizontal">
                    <div class="form-group">
                        <div class="col-sm-2 control-label">经营主体名称</div>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" v-model="employee.subjectName" placeholder="经营主体名称"/>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-sm-2 control-label">员工姓名</div>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" v-model="employee.name" placeholder="员工姓名"/>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-sm-2 control-label">所属部门</div>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" v-model="employee.deptName" placeholder="所属部门"/>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-sm-2 control-label">身份证号</div>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" v-model="employee.cardId" placeholder="身份证号"/>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-sm-2 control-label">员工性别</div>
                        <label class="radio-inline">
                            <input type="radio" name="sex" value="0" v-model="employee.sex"/> 男
                        </label>
                        <label class="radio-inline">
                            <input type="radio" name="sex" value="1" v-model="employee.sex"/> 女
                        </label>
                    </div>
                    <div class="form-group">
                        <div class="col-sm-2 control-label">是否贫困户</div>
                        <label class="radio-inline">
                            <input type="radio" name="ispoor" value="1" v-model="employee.ispoor"/> 否
                        </label>
                        <label class="radio-inline">
                            <input type="radio" name="ispoor" value="0" v-model="employee.ispoor"/> 是
                        </label>
                    </div>
                    <div class="form-group">
                        <div class="col-sm-2 control-label">员工类型</div>
                        <label class="radio-inline">
                            <input type="radio" name="type" value="0" v-model="employee.type"/> 合同工
                        </label>
                        <label class="radio-inline">
                            <input type="radio" name="type" value="1" v-model="employee.type"/> 临时工
                        </label>
                    </div>
                    <div class="form-group">
                        <div class="col-sm-2 control-label">手机号码</div>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" v-model="employee.mobile" placeholder="手机号码"/>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-sm-2 control-label">员工学历</div>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" v-model="employee.educationName" placeholder="学历"/>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-sm-2 control-label">计工类型</div>
                        <label class="radio-inline">
                            <input type="radio" name="wagestype" value="1" v-model="employee.wagestype"/> 月
                        </label>
                        <label class="radio-inline">
                            <input type="radio" name="wagestype" value="2" v-model="employee.wagestype"/> 天
                        </label>
                        <label class="radio-inline">
                            <input type="radio" name="wagestype" value="3" v-model="employee.wagestype"/> 时
                        </label>
                    </div>
                    <div class="form-group">
                        <div class="col-sm-2 control-label">员工角色</div>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" v-model="employee.isassociatorName" placeholder="学历"/>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-sm-2 control-label">状态</div>
                        <label class="radio-inline">
                            <input type="radio" name="status" value="0" v-model="employee.status"/> 离职
                        </label>
                        <label class="radio-inline">
                            <input type="radio" name="status" value="1" v-model="employee.status"/> 正常
                        </label>
                    </div>
                    <div class="form-group">
                        <div class="col-sm-2 control-label">实践经验介绍</div>
                        <div class="col-sm-10">
                            <textarea rows="8" class="form-control" v-model="employee.synopsis" placeholder="实践经验介绍"></textarea>
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-sm-2 control-label"></div>
                        <input type="button" class="btn btn-warning" @click="reload" value="返回"/>
                    </div>
                </form>
            </div>
            <div>
                <div style="display:flex;flex-direction:column;padding-top:20px;">
                    <div>证件照</div>
                    <img :src="employee.pic" alt="证件照" v-model="employee.pic">
                </div>
            </div>
        </div>
	</div>
<div id="div_employee_dialog" style="display:none">
    <form class="form-horizontal">
        <div class="form-group" id="div_employee_username" style="display:none;">
            <div class="col-sm-2 control-label">主体账号</div>
            <div class="col-sm-10">
                <input type="text" class="form-control" id="user_name" placeholder="主体的登录账号|手机号码"/>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-2 control-label">员工姓名</div>
            <div class="col-sm-10">
                <input type="text" class="form-control" id="name" placeholder="员工姓名"/>
                <input type="hidden" id="userId"/>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-2 control-label">所属部门</div>
            <div class="col-sm-10">
                <select id="deptId" title="选择所属部门" class="form-control"></select>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-2 control-label">身份证号</div>
            <div class="col-sm-10">
                <input type="text" class="form-control" id="card_id" placeholder="身份证号"/>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-2 control-label">员工性别</div>
            <label class="radio-inline">
                <input type="radio" name="sex" value="0"/> 男
            </label>
            <label class="radio-inline">
                <input type="radio" name="sex" value="1"/> 女
            </label>
        </div>
        <div class="form-group">
            <div class="col-sm-2 control-label">是否贫困户</div>
            <label class="radio-inline">
                <input type="radio" name="ispoor" value="1"/> 否
            </label>
            <label class="radio-inline">
                <input type="radio" name="ispoor" value="0"/> 是
            </label>
        </div>
        <div class="form-group">
            <div class="col-sm-2 control-label">员工类型</div>
            <label class="radio-inline">
                <input type="radio" name="type" value="0"/> 合同工
            </label>
            <label class="radio-inline">
                <input type="radio" name="type" value="1"/> 临时工
            </label>
        </div>
        <div class="form-group">
            <div class="col-sm-2 control-label">手机号码</div>
            <div class="col-sm-10">
                <input type="text" class="form-control" id="mobile" placeholder="手机号码作为登录名,默认密码6个0"/>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-2 control-label">员工学历</div>
            <div class="col-sm-10">
                <select id="education_id" class="form-control"></select>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-2 control-label">计工类型</div>
            <label class="radio-inline">
                <input type="radio" name="wagestype" value="1"/> 月
            </label>
            <label class="radio-inline">
                <input type="radio" name="wagestype" value="2"/> 天
            </label>
            <label class="radio-inline">
                <input type="radio" name="wagestype" value="3"/> 时
            </label>
        </div>
        <div class="form-group">
            <div class="col-sm-2 control-label">员工角色</div>
            <div class="col-sm-10">
                <select id="isassociator" class="form-control"></select>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-2 control-label">状态</div>
            <label class="radio-inline">
                <input type="radio" name="status" value="0"/> 离职
            </label>
            <label class="radio-inline">
                <input type="radio" name="status" value="1"/> 正常
            </label>
        </div>
        <div class="form-group">
            <div class="col-sm-2 control-label">证件照</div>
            <div class="col-sm-10">
                <input type="file" id="framImages" title="选择证件照" placeholder="选择证件照">
            </div>
        </div>
        <div class="form-group" id="showImages" style="display:none;"></div>
        <div class="form-group">
            <div class="col-sm-2 control-label">实践经验介绍</div>
            <div class="col-sm-10">
                <textarea rows="8" class="form-control" id="synopsis" placeholder="实践经验介绍"></textarea>
            </div>
        </div>
    </form>
</div>
</div>
<script src="${request.contextPath}/statics/js/modules/wit/employee.js?_${.now?long}"></script>
</body>
</html>